using System;
using System.Collections.Generic;
using System.Text;
using CookComputing.XmlRpc;

namespace NMollom.Internal {
    /// <summary>
    /// The parameter bag for the SendFeedback call.
    /// </summary>
    public class SendFeedbackParams : Params {
        [XmlRpcMember("session_id")]
        public string sessionId = "";
        public string feedback = "";

        /// <summary>
        /// Initializes a new instance of the <see cref="SendFeedbackParams"/> class.
        /// </summary>
        /// <param name="auth">The authentication to use.</param>
        /// <param name="assesment">The content assesment related to this feedback.</param>
        /// <param name="feedback">The type of feedback to send.</param>
        public SendFeedbackParams(Authentication auth, ContentAssesment assesment, FeedbackType feedback)
            : base(auth) {
            if (assesment == null)
                throw new ArgumentNullException("assesment");
            this.sessionId = assesment.SessionId;
            this.feedback = MollomTypeConvertor.ToMollomFeedbackType(feedback);
        }
    }
}
